package com.y.fund;

import java.io.File;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@EnableAsync
@EnableAspectJAutoProxy
@ServletComponentScan
@SpringBootApplication(exclude = {
        JpaRepositoriesAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class })
public class FundApplication {

	public static void main(String[] args) {
		/*reset java.io.tmpdir */
		String userDir = System.getProperty("user.dir");
		if(null != userDir) {
			System.setProperty("java.io.tmpdir", userDir + "/jvm_tmpdir");
			String tmpDir = System.getProperty("java.io.tmpdir");
			File f = new File(tmpDir);
			if(!f.exists()) {
				f.mkdirs();
			}
		}

		SpringApplication.run(FundApplication.class, args);
	}

}
